<template>
  <div>
    <!-- -->
    <button @click="num++">增加num</button>
    <div>num值{{num}}</div>
    <div v-beSmall="num"></div>
  </div>
</template>

<script>
export default {
  name: 'CustomDirective',

  data() {
    return {
      num:11
    };
  },

  mounted() {
    
  },

  directives:{
    beSmall(element,bind){
        element.innerText = bind.value*10;
    }
  },
  methods: {
    
  },
};
</script>